home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / file / ro_v091.lha / RO / ARexx / AddArc.RO < prev    next >
Encoding:
Text File  |  1995-01-20  |  1.3 KB  |  76 lines

  1. /* 
  2.  
  3.    $VER: AddArc.RO 0.1
  4.  
  5.    Author:
  6.     Oliver Rummeyer (oliver.rummeyer@student.uni-ulm.de)
  7.  
  8.    Function:
  9.     Archives all selected files via Stefan Boberg's LhA. Using this
  10.     script is much faster than using the standard built-in function
  11.     because LhA isn't started for every file. Another advantage is
  12.     that it shows the progress output on screen.
  13.  
  14.    Requires:
  15.     Lha command in the AmigaDOS search path
  16.  
  17.    Example:
  18.     BUTTON 8 COMMAND "Arc" "Rx >NIL: REXX:AddArc.RO"
  19.  
  20. */
  21.  
  22. ADDRESS 'RO.1'
  23. OPTIONS RESULTS
  24.  
  25. Files=''
  26.  
  27. 'Sleep'
  28.  
  29. 'Path Active'
  30. IF RESULT="RESULT" THEN
  31.  DO
  32.   'Wakeup'
  33.   EXIT 5
  34.  END
  35. SourceDir=RESULT
  36.  
  37. 'NumEntries Active Entries'
  38. Num=RESULT
  39. IF Num~=0 THEN
  40.  DO
  41.  
  42.   'StringReq ""'
  43.   IF RESULT="RESULT" THEN
  44.   DO
  45.    'Wakeup'
  46.    EXIT 5
  47.   END
  48.   Name=RESULT
  49.  
  50.   DO Index=1 TO Num
  51.    'GetEntry Active Entries'
  52.    FileName=RESULT
  53.  
  54.    Position=LASTPOS("/",FileName)
  55.    IF Position=0 THEN
  56.     Position=LASTPOS(":",FileName)
  57.    NewName=SUBSTR(FileName,Position+1)
  58.    Files=Files||'*"'||NewName||'*"'||' '
  59.  
  60.    IF LENGTH(Files) > 180 | Index = Num THEN
  61.     DO
  62.      'Message "Adding entries to archive..."'
  63.      'Command "LhA -x -r a *"'||Name||'*" '||Files||' &c" ""'
  64.      IF RC ~= 0 THEN
  65.       DO
  66.        'Wakeup'
  67.        EXIT 5
  68.       END
  69.      Files=''
  70.     END
  71.   END
  72.  
  73. END
  74.  
  75. 'Wakeup'
  76.